﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5.官方列子简化版
{
    //建造者实现
    //封装制造细节
    public class Builder1 : AbstractBuilder
    {
        private Product Product { get; set; }

        public Builder1()
        {
            Product = new Product();
        }

        protected override void Part1()
        {
            Product.Add("part1");
        }

        protected override void Part2()
        {
            Product.Add("part2");
        }

        public override Product GetProduct()
        {
            Part1();
            Part2();
            return Product;
        }
    }
}
